<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //******************************** let
        // let x = 10;
        // {
        //     let x = 20;
        // }
        // console.log(x);

        //******************************** const
        // let x = 10;
        // {
        //     const x = 20;
        // }
        // x = 5;
        // console.log(x);

        //******************************** (**)
        // let x = 5;
        // let xx = x**2
        // console.log(xx);
        // console.log(Math.pow(x,2));
        
        //******************************** 默认参数值
        // function func(x, y = 2){
        //     return x + y;
        // }
        // let result = func(3);
        // console.log(result);

        //******************************** arr.find()
        // let arr = ["a","b","c"];
        // let results = arr.find(function(a, index ,arr){
        //     if(a == "b" || a == "c"){
        //         return true
        //     }
        //     console.log("this:",this);
        //     console.log("first parameter:", a);
        //     console.log("second parameter:", index);
        //     console.log("third parameter:", arr);
        // },arr);
        // console.log("results:", results);

        //******************************** arr.findIndex()
        // let arr = ["a","b","c"];
        // let results = arr.findIndex(function(a, index ,arr){
        //     if(a == "b" || a == "c"){
        //         return true
        //     }
        //     console.log("this:",this);
        //     console.log("first parameter:", a);
        //     console.log("second parameter:", index);
        //     console.log("third parameter:", arr);
        // },arr);
        // console.log("results:", results);

        //******************************** Number.EPSILON Number.MIN_SAFE_INTEGER Number.MAX_SAFE_INTEGER
        // console.log(Number.EPSILON, Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
        // const x = 0.2;
        // const y = 0.3;
        // const z = 0.1;
        // let equal = (Math.abs(x-y+z) < Number.EPSILON);
        // console.log(equal);

        //******************************** Number.isInteger() Number.isSafeInteger()
        // console.log(Number.isInteger(1));
        // console.log(Number.isInteger(1.5));
        // console.log(Number.isSafeInteger(9007199254740991));
        // console.log(Number.isSafeInteger(9007199254740992));

        //******************************** isFinite() isNaN()
        // console.log(isFinite(10/0));
        // console.log(isFinite(10/1));
        // console.log(isNaN(10/0));
        // console.log(isNaN("hello"));

        //******************************** 箭头函数
        // // ES5
        // var x = function(a, b) {
        //     return a * b;
        // }
        // // ES6
        // const y = (a, b) => a * b;

        // console.log(x(2,3));
        // console.log(y(2,3));



    </script>
</body>
</html>